dict_a = {'name':'anxin1','id':'01'}
dict_b = {'name':'anxin2','id':'02'}
dict_c = {'name':'anxin3','id':'03'}
dict_d = {'name':'anxin4','id':'04'}
users = [dict_a,dict_b,dict_c,dict_d]


def chk_name(username):     #判断姓名
    global user
    for user in users:
        if username == user['name']:
            return True
    return False


def chk_id(suerid):          #判断id
    if userid == user['id']:
        return True
    return False


flag = 0
for i in range(3):
    username = input("姓名:")
    if chk_name(username):
        for j in range(3):
            userid = input("id:")
            if chk_id(userid):
                print("登陆成功")
                flag = 1
                break
            else:
                print("id错误")
        if flag == 0:
            print("id输错三次")
    else:
        print("姓名错误")
    if flag == 1:
        break
if flag == 0:
    print("姓名输错三次")












